#include "syscall.h"

int main(void)
{
	int inputval;
	int nNumofExecs;
	int i = 0;
	
	Write("\t*** Test Cases Options for Project-II Part B ***\n\n\n", 50, 1);

	Write("0 -> Test Executing One Exec and One Fork\n", 43, 1);
	Write("1 -> Test Executing One Exec and Multiple Fork\n", 48, 1);
	Write("2 -> Test Executing Multiple Exec and Multiple Fork\n", 52, 1);
	Write("3 -> Test Executing Exec with Invalid Parameters\n", 52, 1);
	
	inputval = GetInputInt("Choice", 6);
	switch(inputval)
	{
		case 0:
			Write("Executing One Exec and One Fork\n", 33, 1);
			Exec("../test/proj2pb_test1");
			break;
		
		case 1:
			Write("Executing One Exec and Multiple Fork\n", 38, 1);
			Exec("../test/proj2pb_test2");
			break;
		
		case 2:
			Write("Executing Multiple Exec and Multiple Fork\n", 42, 1);
			nNumofExecs = GetInputInt("Number Of Execs to Execute", 27);
			
			if (nNumofExecs < 0)
			{
				Write("Invalid value entered - Setting to default of 3\n", 50, 1);
				nNumofExecs = 3;
			}

			for (i = 0; i < nNumofExecs; i++)
			{
				Exec("../test/proj2pb_test2");
			}
			break;
		
		case 3:
			Write("Executing Exec with Invalid Parameters\n", 42, 1);
			Exec("../test/InvalidFileName");
			break;
			
		default:
			Write("Invalid Choice\n", 16, 1);
			break;
	}
	
}
